package com.ms.demo;

/**
 * @description: 使用 Broker 类来接受并执行命令
 * @author: ms
 * @create: 2022-10-27 17:04
 */
public class TestMain {

    public static void main(String[] args) {

        Stock abcStock = new Stock();

        BuyStock buyStockOrder = new BuyStock(abcStock);
        SellStock sellStockOrder = new SellStock(abcStock);

        Broker broker = new Broker();
        broker.takeOrder(buyStockOrder);
        broker.takeOrder(sellStockOrder);

        broker.placeOrders();
    }
}